home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
nivb
/
dirdrive.frm
< prev
next >
Wrap
Text File
|
1995-05-07
|
3KB
|
80 lines
VERSION 2.00
Begin Form DirDriveForm
Caption = "Directory Services Test (Drive APIs)"
ClientHeight = 3000
ClientLeft = 870
ClientTop = 1530
ClientWidth = 6360
Height = 3405
Left = 810
LinkTopic = "Form2"
ScaleHeight = 3000
ScaleWidth = 6360
Top = 1185
Width = 6480
Begin ListBox DriveList
Height = 1980
Left = 120
TabIndex = 1
Top = 360
Width = 6135
End
Begin CommandButton OKButton
Caption = "&OK"
Height = 372
Left = 3000
TabIndex = 0
Top = 2520
Width = 732
End
Begin Label Label2
Caption = "* Search drives"
Height = 252
Left = 120
TabIndex = 3
Top = 2400
Width = 1332
End
Begin Label Label1
Caption = "Network drive mappings"
Height = 252
Left = 120
TabIndex = 2
Top = 120
Width = 2172
End
End
Sub OKButton_Click ()
Unload DirDriveForm
End Sub
Sub Form_Load ()
'DriveList.Clear
For drive% = 0 To 25
ccode% = GetDriveInformation(drive%, connID%, dirHandle%)
If (dirHandle% <> 0) Then
dirPath$ = String$(255, 0)
ccode% = GetDirectoryPath(dirHandle%, dirPath$)
dirPath$ = Left$(dirPath$, InStr(dirPath$, Chr$(0)) - 1)
If (ccode% = SUCCESSFUL) Then
fileServerName$ = String$(48, 0)
GetFileServerName connID%, fileServerName$
fileServerName$ = Left$(fileServerName$, InStr(fileServerName$, Chr$(0)) - 1)
If (IsSearchDrive(drive% + 65) = 1) Then
DriveList.AddItem "* " + Chr$(drive% + 65) + ": " + fileServerName$ + "/" + dirPath$
Else
DriveList.AddItem " " + Chr$(drive% + 65) + ": " + fileServerName$ + "/" + dirPath$
End If
Else
DriveList.AddItem "Can't get path for this drive"
End If
ElseIf (ccode% <> SUCCESSFUL) Then
DriveList.AddItem " " + Chr$(drive% + 65) + ": " + "Mapped to a local drive"
End If
Next drive%
End Sub